import { Button, Result } from 'antd';

import { memo } from 'react';
import { useHistory } from 'react-router-dom';

const Forbidden = memo(() => {
  const history = useHistory();
  const goHome = () => {
    history.replace('/');
  };
  return (
    <Result
      status="403"
      title="拒绝访问"
      subTitle="没有权限访问，请联系管理员"
      extra={
        <Button type="primary" onClick={goHome}>
          返回首页
        </Button>
      }
    />
  );
});

export default Forbidden;
